﻿using CUREBusinessLogicLayer;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CURE.SystemManagement
{
    public partial class PDAAuthorityList : System.Web.UI.Page
    {
        #region 变量
        private string info;

        public string Info
        {
            get { return info; }
            set { info = value; }
        }
        private string groupname;

        public string Groupname
        {
            get { return groupname; }
            set { groupname = value; }
        }
        #endregion

        AuthorityBll authoritybll = new AuthorityBll();
        protected void Page_Load(object sender, EventArgs e)
        {
            info = Request.QueryString["info"];
            groupname = authoritybll.GetGroupNameByInfo(info);
        }

        

        /// <summary>
        /// 获取已配置的权限
        /// </summary>
        /// <returns></returns>
        public string getActionStr()
        {
            string actionList = "";
            if (info != null && info != "")
            {
                Dictionary<string, object> dictionry = new Dictionary<string, object>();
                dictionry.Add("info", info);
                DataTable dt = default(DataTable);
                dt = authoritybll.getActionStrByGroupInfoPDA(dictionry);
                if (dt != null && dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        actionList += dt.Rows[i]["action"].ToString() + ",";
                    }
                }
                actionList = actionList.TrimEnd(',');
                return actionList;
            }
            else
            {
                return "";
            }
        }
    }
}